import { NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router";
import { authGuard } from "./auth.guard";
import { ClientsComponent } from "./pages/clients/clients.component";
import { DeptComponent } from "./pages/dept/dept.component";
import { PermissionDetailComponent } from "./pages/permission/permission-detail/permission-detail.component";
import { PermissionComponent } from "./pages/permission/permission.component";
import { RoleComponent } from "./pages/role/role.component";
import { MenuComponent } from "./pages/menu/menu.component";
import { EmployeeComponent } from "./pages/employee/employee.component";
import { HomeComponent } from "./components/home/home.component";
import { LoginComponent } from "./pages/login/login.component";
import { EndUserComponent } from "./pages/end-user/end-user.component";
import { GroupComponent } from "./pages/group/group.component";
import { PostComponent } from "./pages/post/post.component";

const routes: Routes = [
    { path: 'login', component: LoginComponent },
    { path: '', component: HomeComponent, pathMatch: 'full' },
    { path: 'home', component: HomeComponent, pathMatch: 'full', canActivate: [authGuard] },
    { path: 'client', component: ClientsComponent, pathMatch: 'full' },
    { path: 'permission', component: PermissionComponent, pathMatch:'full'},
    { path: 'permission-detail', component: PermissionDetailComponent, pathMatch: 'full'},
    { path: 'dept', component: DeptComponent, pathMatch: 'full'},
    { path: 'role', component: RoleComponent, pathMatch: 'full'},
    { path: 'menu', component: MenuComponent, pathMatch: 'full'},
    { path: 'employee', component: EmployeeComponent, pathMatch: 'full'},
    { path: 'end-user', component: EndUserComponent, pathMatch: 'full'},
    { path: 'group', component: GroupComponent, pathMatch: 'full'},
    { path: 'post', component: PostComponent, pathMatch: 'full'},
]
@NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
  })
  export class AppRoutingModule { }